#!/bin/bash

# 公共配置
COMPOSE_FILE="docker-compose.yml"

function build() {
    echo "🔧 Building images..."
    DOCKER_BUILDKIT=1 docker-compose -f "$COMPOSE_FILE" build
}

function up() {
    echo "🚀 Starting containers..."
    docker-compose -f "$COMPOSE_FILE" up -d
}

function down() {
    echo "🧹 Stopping containers..."
    docker-compose -f "$COMPOSE_FILE" down
}

function logs() {
    docker-compose -f "$COMPOSE_FILE" logs -f --tail=100
}

function restart() {
    down
    build
    up
}

function help() {
    echo "Usage: $0 {build|up|down|logs|restart|help}"
}
